import request from "@/utils/request"

export default {
  // 创建订单
  createOrder(data) {
    return request({
      url: `/order/create`,
      method: "post",
      data,
    })
  },

  orderDetail(params) {
    return request({
      url: `/order/detail`,
      method: "get",
      params,
    })
  },

  updateDetail(data) {
    return request({
      url: `/order/update`,
      method: "post",
      data,
    })
  },
  // 操作记录
  ofeeList(params) {
    return request({
      url: `/order/expense/order`,
      method: "get",
      params,
    })
  },

  skuFee(params) {
    return request({
      url: `/order/expense/sku`,
      method: "get",
      params,
    })
  },

  // http://10.20.9.32:40001/project/65/interface/api/8095
  skuInventory(data) {
    return request({
      baseURL: window.APP_GETEWAY.wms,
      url: `/api/sku-inventory`,
      method: "post",
      data,
    })
  },
  ownerInventory(data) {
    return request({
      baseURL: window.APP_GETEWAY.wms,
      url: `/api/owner-inventory`,
      method: "post",
      data,
    })
  },
  platformInventory(data) {
    return request({
      baseURL: window.APP_GETEWAY.wms,
      url: `/api/platform-inventory`,
      method: "post",
      data,
    })
  },
  // /internal/api/sku-inventory
  againCalculate(data) {
    return request({
      url: `/order/expense/againCalculate`,
      method: "post",
      data,
    })
  },
  updatePurchasePrice(data) {
    return request({
      url: `/order/expense/updatePurchasePrice`,
      method: "post",
      data,
    })
  },
  // 订单新增默认数据
  orderCreateDefault(params) {
    return request({
      url: `/order/createDefault`,
      method: "get",
      params,
    })
  },
  // 订单店铺销售数据列表
  // http://10.20.9.32:40001/project/57/interface/api/21081
  orderShopSaleList(data) {
    return request({
      url: `/order/shopSaleList`,
      method: "post",
      data,
    })
  },
}
